home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / include / amiga20 / clib / dos_protos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-11  |  9.9 KB  |  243 lines

  1. #ifndef  CLIB_DOS_PROTOS_H
  2. #define  CLIB_DOS_PROTOS_H
  3. /*
  4. **    $Filename: clib/dos_protos.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 30.156 $
  7. **    $Date: 1995/01/11 05:18:08 $
  8. **
  9. **    C prototypes. For use with 32 bit integers only.
  10. **
  11. **    (C) Copyright 1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14. /* "dos.library" */
  15. #ifndef  DOS_DOS_H
  16. #include <dos/dos.h>
  17. #endif
  18. #ifndef  DOS_DOSEXTENS_H
  19. #include <dos/dosextens.h>
  20. #endif
  21. #ifndef  DOS_RECORD_H
  22. #include <dos/record.h>
  23. #endif
  24. #ifndef  DOS_RDARGS_H
  25. #include <dos/rdargs.h>
  26. #endif
  27. #ifndef  DOS_DOSASL_H
  28. #include <dos/dosasl.h>
  29. #endif
  30. #ifndef  DOS_VAR_H
  31. #include <dos/var.h>
  32. #endif
  33. #ifndef  DOS_NOTIFY_H
  34. #include <dos/notify.h>
  35. #endif
  36. #ifndef  DOS_DATETIME_H
  37. #include <dos/datetime.h>
  38. #endif
  39. BPTR Open( UBYTE *name, long accessMode );
  40. LONG Close( BPTR file );
  41. LONG Read( BPTR file, APTR buffer, long length );
  42. LONG Write( BPTR file, APTR buffer, long length );
  43. BPTR Input( void );
  44. BPTR Output( void );
  45. LONG Seek( BPTR file, long position, long offset );
  46. LONG DeleteFile( UBYTE *name );
  47. LONG Rename( UBYTE *oldName, UBYTE *newName );
  48. BPTR Lock( UBYTE *name, long type );
  49. void UnLock( BPTR lock );
  50. BPTR DupLock( BPTR lock );
  51. LONG Examine( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  52. LONG ExNext( BPTR lock, struct FileInfoBlock *fileInfoBlock );
  53. LONG Info( BPTR lock, struct InfoData *parameterBlock );
  54. BPTR CreateDir( UBYTE *name );
  55. BPTR CurrentDir( BPTR lock );
  56. LONG IoErr( void );
  57. struct MsgPort *CreateProc( UBYTE *name, long pri, BPTR segList,
  58.     long stackSize );
  59. void Exit( long returnCode );
  60. BPTR LoadSeg( UBYTE *name );
  61. void UnLoadSeg( BPTR seglist );
  62. struct MsgPort *DeviceProc( UBYTE *name );
  63. LONG SetComment( UBYTE *name, UBYTE *comment );
  64. LONG SetProtection( UBYTE *name, long protect );
  65. struct DateStamp *DateStamp( struct DateStamp *date );
  66. void Delay( long timeout );
  67. LONG WaitForChar( BPTR file, long timeout );
  68. BPTR ParentDir( BPTR lock );
  69. LONG IsInteractive( BPTR file );
  70. LONG Execute( UBYTE *string, BPTR file, BPTR file2 );
  71. /*--- functions in V36 or higher (distributed as Release 2.0) ---*/
  72. /*    DOS Object creation/deletion */
  73. APTR AllocDosObject( unsigned long type, struct TagItem *tags );
  74. APTR AllocDosObjectTagList( unsigned long type, struct TagItem *tags );
  75. APTR AllocDosObjectTags( unsigned long type, unsigned long tag1type, ... );
  76. void FreeDosObject( unsigned long type, APTR ptr );
  77. /*    Packet Level routines */
  78. LONG DoPkt( struct MsgPort *port, long action, long arg1, long arg2, long arg3,
  79.     long arg4, long arg5 );
  80. LONG DoPkt0( struct MsgPort *port, long action );
  81. LONG DoPkt1( struct MsgPort *port, long action, long arg1 );
  82. LONG DoPkt2( struct MsgPort *port, long action, long arg1, long arg2 );
  83. LONG DoPkt3( struct MsgPort *port, long action, long arg1, long arg2,
  84.     long arg3 );
  85. LONG DoPkt4( struct MsgPort *port, long action, long arg1, long arg2,
  86.     long arg3, long arg4 );
  87. void SendPkt( struct DosPacket *dp, struct MsgPort *port,
  88.     struct MsgPort *replyport );
  89. struct DosPacket *WaitPkt( void );
  90. void ReplyPkt( struct DosPacket *dp, long res1, long res2 );
  91. void AbortPkt( struct MsgPort *port, struct DosPacket *pkt );
  92. /*    Record Locking */
  93. BOOL LockRecord( BPTR fh, unsigned long offset, unsigned long length,
  94.     unsigned long mode, unsigned long timeout );
  95. BOOL LockRecords( struct RecordLock *recArray, unsigned long timeout );
  96. BOOL UnLockRecord( BPTR fh, unsigned long offset, unsigned long length );
  97. BOOL UnLockRecords( struct RecordLock *recArray );
  98. /*    Buffered File I/O */
  99. BPTR SelectInput( BPTR fh );
  100. BPTR SelectOutput( BPTR fh );
  101. LONG FGetC( BPTR fh );
  102. void FPutC( BPTR fh, unsigned long ch );
  103. LONG UnGetC( BPTR fh, long character );
  104. LONG FRead( BPTR fh, APTR block, unsigned long blocklen,
  105.     unsigned long number );
  106. LONG FWrite( BPTR fh, APTR block, unsigned long blocklen,
  107.     unsigned long number );
  108. UBYTE *FGets( BPTR fh, UBYTE *buf, unsigned long buflen );
  109. LONG FPuts( BPTR fh, UBYTE *str );
  110. void VFWritef( BPTR fh, UBYTE *format, LONG *argarray );
  111. void FWritef( BPTR fh, UBYTE *format, long arg1, ... );
  112. LONG VFPrintf( BPTR fh, UBYTE *format, LONG *argarray );
  113. LONG FPrintf( BPTR fh, UBYTE *format, long arg1, ... );
  114. void Flush( BPTR fh );
  115. LONG SetVBuf( BPTR fh, UBYTE *buff, long type, long size );
  116. /*    DOS Object Management */
  117. BPTR DupLockFromFH( BPTR fh );
  118. BPTR OpenFromLock( BPTR lock );
  119. BPTR ParentOfFH( BPTR fh );
  120. BOOL ExamineFH( BPTR fh, struct FileInfoBlock *fib );
  121. LONG SetFileDate( UBYTE *name, struct DateStamp *date );
  122. LONG NameFromLock( BPTR lock, UBYTE *buffer, long len );
  123. LONG NameFromFH( BPTR fh, UBYTE *buffer, long len );
  124. WORD SplitName( UBYTE *name, unsigned long seperator, UBYTE *buf, long oldpos,
  125.     long size );
  126. LONG SameLock( BPTR lock1, BPTR lock2 );
  127. LONG SetMode( BPTR fh, long mode );
  128. LONG ExAll( BPTR lock, struct ExAllData *buffer, long size, long data,
  129.     struct ExAllControl *control );
  130. LONG ReadLink( struct MsgPort *port, BPTR lock, UBYTE *path, UBYTE *buffer,
  131.     unsigned long size );
  132. LONG MakeLink( UBYTE *name, long dest, long soft );
  133. LONG ChangeMode( long type, BPTR fh, long newmode );
  134. LONG SetFileSize( BPTR fh, long pos, long mode );
  135. /*    Error Handling */
  136. LONG SetIoErr( long result );
  137. BOOL Fault( long code, UBYTE *header, UBYTE *buffer, long len );
  138. BOOL PrintFault( long code, UBYTE *header );
  139. LONG ErrorReport( long code, long type, unsigned long arg1,
  140.     struct MsgPort *device );
  141. /*    Process Management */
  142. struct CommandLineInterface *Cli( void );
  143. struct Process *CreateNewProc( struct TagItem *tags );
  144. struct Process *CreateNewProcTagList( struct TagItem *tags );
  145. struct Process *CreateNewProcTags( unsigned long tag1type, ... );
  146. LONG RunCommand( BPTR seg, long stack, UBYTE *paramptr, long paramlen );
  147. struct MsgPort *GetConsoleTask( void );
  148. struct MsgPort *SetConsoleTask( struct MsgPort *task );
  149. struct MsgPort *GetFileSysTask( void );
  150. struct MsgPort *SetFileSysTask( struct MsgPort *task );
  151. UBYTE *GetArgStr( void );
  152. BOOL SetArgStr( UBYTE *string );
  153. struct Process *FindCliProc( unsigned long num );
  154. ULONG MaxCli( void );
  155. BOOL SetCurrentDirName( UBYTE *name );
  156. BOOL GetCurrentDirName( UBYTE *buf, long len );
  157. BOOL SetProgramName( UBYTE *name );
  158. BOOL GetProgramName( UBYTE *buf, long len );
  159. BOOL SetPrompt( UBYTE *name );
  160. BOOL GetPrompt( UBYTE *buf, long len );
  161. BPTR SetProgramDir( BPTR lock );
  162. BPTR GetProgramDir( void );
  163. /*    Device List Management */
  164. LONG SystemTagList( UBYTE *command, struct TagItem *tags );
  165. LONG System( UBYTE *command, struct TagItem *tags );
  166. LONG SystemTags( UBYTE *command, unsigned long tag1type, ... );
  167. LONG AssignLock( UBYTE *name, BPTR lock );
  168. BOOL AssignLate( UBYTE *name, UBYTE *path );
  169. BOOL AssignPath( UBYTE *name, UBYTE *path );
  170. BOOL AssignAdd( UBYTE *name, BPTR lock );
  171. LONG RemAssignList( UBYTE *name, BPTR lock );
  172. struct DevProc *GetDeviceProc( UBYTE *name, struct DevProc *dp );
  173. void FreeDeviceProc( struct DevProc *dp );
  174. struct DosList *LockDosList( unsigned long flags );
  175. void UnLockDosList( unsigned long flags );
  176. struct DosList *AttemptLockDosList( unsigned long flags );
  177. BOOL RemDosEntry( struct DosList *dlist );
  178. struct DosList *AddDosEntry( struct DosList *dlist );
  179. struct DosList *FindDosEntry( struct DosList *dlist, UBYTE *name,
  180.     unsigned long flags );
  181. struct DosList *NextDosEntry( struct DosList *dlist, unsigned long flags );
  182. struct DosList *MakeDosEntry( UBYTE *name, long type );
  183. void FreeDosEntry( struct DosList *dlist );
  184. BOOL IsFileSystem( UBYTE *name );
  185. /*    Handler Interface */
  186. BOOL Format( UBYTE *filesystem, UBYTE *volumename, unsigned long dostype );
  187. LONG Relabel( UBYTE *drive, UBYTE *newname );
  188. LONG Inhibit( UBYTE *name, long onoff );
  189. LONG AddBuffers( UBYTE *name, long number );
  190. /*    Date, Time Routines */
  191. LONG CompareDates( struct DateStamp *date1, struct DateStamp *date2 );
  192. LONG DateToStr( struct DateTime *datetime );
  193. LONG StrToDate( struct DateTime *datetime );
  194. /*    Image Management */
  195. BPTR InternalLoadSeg( BPTR fh, BPTR table, LONG *funcarray, LONG *stack );
  196. void InternalUnLoadSeg( BPTR seglist, void (*freefunc)() );
  197. BPTR NewLoadSeg( UBYTE *file, struct TagItem *tags );
  198. BPTR NewLoadSegTagList( UBYTE *file, struct TagItem *tags );
  199. BPTR NewLoadSegTags( UBYTE *file, unsigned long tag1type, ... );
  200. LONG AddSegment( UBYTE *name, BPTR seg, long system );
  201. struct Segment *FindSegment( UBYTE *name, struct Segment *seg, long system );
  202. LONG RemSegment( struct Segment *seg );
  203. /*    Command Support */
  204. LONG CheckSignal( long mask );
  205. struct RDArgs *ReadArgs( UBYTE *template, LONG *array, struct RDArgs *args );
  206. LONG FindArg( UBYTE *keyword, UBYTE *template );
  207. LONG ReadItem( UBYTE *name, long maxchars, struct CSource *cSource );
  208. LONG StrToLong( UBYTE *string, LONG *value );
  209. LONG MatchFirst( UBYTE *pat, struct AnchorPath *anchor );
  210. LONG MatchNext( struct AnchorPath *anchor );
  211. void MatchEnd( struct AnchorPath *anchor );
  212. BOOL ParsePattern( UBYTE *pat, UBYTE *buf, long buflen );
  213. BOOL MatchPattern( UBYTE *pat, UBYTE *str );
  214. /* Not currently implemented. */
  215. void FreeArgs( struct RDArgs *args );
  216. UBYTE *FilePart( UBYTE *path );
  217. UBYTE *PathPart( UBYTE *path );
  218. BOOL AddPart( UBYTE *dirname, UBYTE *filename, unsigned long size );
  219. /*    Notification */
  220. BOOL StartNotify( struct NotifyRequest *notify );
  221. void EndNotify( struct NotifyRequest *notify );
  222. /*    Environment Variable functions */
  223. BOOL SetVar( UBYTE *name, UBYTE *buffer, long size, long flags );
  224. LONG GetVar( UBYTE *name, UBYTE *buffer, long size, long flags );
  225. LONG DeleteVar( UBYTE *name, unsigned long flags );
  226. struct LocalVar *FindVar( UBYTE *name, unsigned long type );
  227. LONG CliInit( struct DosPacket *dp );
  228. LONG CliInitNewcli( struct DosPacket *dp );
  229. LONG CliInitRun( struct DosPacket *dp );
  230. LONG WriteChars( UBYTE *buf, unsigned long buflen );
  231. LONG PutStr( UBYTE *str );
  232. LONG VPrintf( UBYTE *format, LONG *argarray );
  233. LONG Printf( UBYTE *format, long arg1, ... );
  234. /* these were unimplemented until dos 36.147 */
  235. BOOL ParsePatternNoCase( UBYTE *pat, UBYTE *buf, long buflen );
  236. BOOL MatchPatternNoCase( UBYTE *pat, UBYTE *str );
  237. /* this was added for V37 dos, returned 0 before then. */
  238. BOOL SameDevice( BPTR lock1, BPTR lock2 );
  239. /* These were added in dos 36.147 */
  240. /* these were added in dos 37.1 */
  241. /* these were added in dos 37.8 */
  242. #endif     /* CLIB_DOS_PROTOS_H */
  243.